package com.yuxinyang.memory.admin.common;

import org.springframework.beans.propertyeditors.StringTrimmerEditor;
import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.InitBinder;

/**
 * 公共控制器
 *
 * @author 余秀良
 * @version 1.0
 * <p>date: 2019年08月29日  11:11 </p>
 * <p>address: 四川成都 </p>
 */
@CrossOrigin
public class BaseController {
    @InitBinder
    protected void initBinder(WebDataBinder binder) {
        StringTrimmerEditor stringTrimmerEditor = new StringTrimmerEditor(true);
        binder.registerCustomEditor(String.class, stringTrimmerEditor);
    }
}
